<?php
	class Database {
		private $host ;
		private $user ;
		private $password ;
		private $database ;
		//myqli nesnesi
		private $mysqli ;
		private $query ;
		private $query_result ;
		
		public function __construct ( $host, $user, $password, $database ) {
			$this -> host = $host ;
			$this -> user = $user ;
			$this -> password = $password ;
			$this -> database = $database ;
		}
		
		public function connect ( ) {
			$this -> mysqli = new mysqli ( $this -> host, $this -> user, $this -> password, $this -> database ) ;
			if ( $this -> mysqli -> connect_error ) {
				die ( 'Connect Error (' . $this -> mysqli -> connect_errno . ') '. $this -> mysqli -> connect_error ) ;
			}
		}
		
		public function makequery ( $query ) {
			$this -> query = $query ;
			$this -> query_result = mysqli_query ( $this -> conncection, $this -> query ) ;
		}
	}
?>
